/*************************************************************************
	> File Name: hash_table.cpp
	> Author: 
	> Mail: 
	> Created Time: Mon 12 Aug 2024 08:39:35 PM CST
 ************************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct Node
{
	char *s;
	struct Node *next;
} Node;

typedef struct HashTable
{
	Node *data;
	int size, cnt;
} HashTable;

Node *getNewNode(const char *s) {
	Node *p = (Node *)malloc(sizeof(Node));
	p->s = strdup(s);
	p->next = NULL;
	return p;
}

HashTable *initHashTable(int n) {
	HashTable *h = (HashTable *)malloc(sizeof(HashTable));
	h->data = (Node *)malloc(sizeof(Node) * n);
	h->size = n;
	h->cnt = 0;
	return h;
}




